export function dateFormat(dateStr) {
  const date = new Date(dateStr)
  return `${date.getFullYear()}-${formatNumber(date.getMonth() + 1)}-${formatNumber(date.getDate())}` +
    ` ${formatNumber(date.getHours())}:${formatNumber(date.getMinutes())}:${formatNumber(date.getSeconds())}`
}

function formatNumber(x) {
  if (x >= 10) {
    return x
  } else {
    return '0' + x
  }
}
